{extend name="base/form_base" /}
{block name="style"}
<style type="text/css">

</style>
{/block}
{block name="content"}
<div class="layui-fluid">
<form class="layui-form" id='edit_form' onsubmit="return false">

    
            
            <div class="layui-form-item">
            <label class="layui-form-label">智能云：</label>
                <div class="layui-input-inline">
                  <select class="layui-input" name='rid' id='rid'>
                    <option value="">全部</option>
                    {foreach $robot as $val}
                      <option value="{$val.id}">{$val.name}</option>
                    {/foreach}
                  </select>
                </div>
          </div>
          <div class="layui-form-item">
                <label class="layui-form-label">比例：</label>
                <div class="layui-input-inline">
                    <input type="text" name="rate" autocomplete="off" class="layui-input" id='rate' value="">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">时间：</label>
                <div class="layui-input-inline">
                    <input type="text" name="date" autocomplete="off" class="layui-input" id='date' placeholder="YYYY-MM-DD">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-inline" style="width: 80px">
                  <button class="layui-btn" onclick="ajax()" lay-filter="formDemo">确定 </button>
                </div>
            </div>

</form>
</div>  
{/block}
{block name="script"}
<script type="text/javascript">
  function ajax(){
    var post_data = $('#edit_form').serialize();
    $.ajax({
            url:"{:url('admin/invest/addRate')}",
            type:"POST",
            data:post_data,
            success:function(ret){
                if (ret.code == 0) {
                  layer.msg('操作成功');
                  parent.$(".layui-laypage-btn")[0].click();
                }
                if (ret.code == 1) {
                    layer.msg(ret.msg);
                }
            }
        });
  }
</script> 
{/block}